﻿namespace Kernelx.Extensions
{
    using Kernelx.Contexts;
    using Kernelx.Contexts.Defaults;
    using Kernelx.Extensions._Internals;


    /// <summary>
    /// 
    /// </summary>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:命名样式", Justification = "<挂起>")]
    internal static class _ServiceContainer
    {
         
        private static IClauseConverter _clauseConverter;
        internal static IClauseConverter GetClauseConverter() => _clauseConverter ??
            (_clauseConverter = !WorkloadStartupContext.HasCurrent() ? new ClauseConverter() : WorkloadStartupContext.Current.GetService<IClauseConverter>() ?? new ClauseConverter());




        private static IMapper _mapper;
        internal static IMapper GetMapper() => _mapper ??
            (_mapper = !WorkloadStartupContext.HasCurrent() ? new Mapper() : WorkloadStartupContext.Current.GetService<IMapper>() ?? new Mapper());

         

    }
}
